package com.Archive.firstWeek;

public class array {
    public static void main(String[] args) {
        int n = 1,s = 0;
        boolean flg = false;
        int[] arr = new int[] {1,2,3,4,5,6,7,1,2,3,1};
        for(int i = 0;i<arr.length;i++){
            if(arr[i] == n){
                System.out.print(i+1 + "\t");
                System.out.println("找到了1");
                s++;
                flg = true;
            }
            if(!flg){
                System.out.println("没找到。。");
            }
        }
//        for (int a:arr) {
//            if(a == n){
//                System.out.println("找到了！");
//                flg = true;
//                break;
//            }
//        }
        System.out.println("一共找到"+s+"个"+n);
    }
}
